<template>
  <div class="technology-page">
    <img src="../assets/StatusBar/Light.png" alt="">
    <div class="top">
      <div class="arrow" @click="$router.push('/user')">
        <van-icon name="arrow-left" size="20px" class="arrow-left"/>
      </div>
      <span class="title">热门技术</span>
    </div>
    <div ref="box" class="chart-box">
      <!-- 图表区域 -->
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'technology-page',
  mounted () {
    const myChart = echarts.init(this.$refs.box)
    myChart.setOption({
      tooltip: {
        trigger: 'item'
      },
      legend: {
        left: 'left',
        top: 'bottom'
      },
      series: [
        {
          type: 'pie',
          radius: ['40%', '70%'],
          avoidLabelOverlap: false,
          label: {
            show: false,
            position: 'inside'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: 17
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { value: 40, name: '面试' },
            { value: 120, name: '后端' },
            { value: 80, name: '前端' },
            { value: 280, name: '区块链' },
            { value: 300, name: '数据库' },
            { value: 300, name: 'CSS' },
            { value: 300, name: 'C++' },
            { value: 100, name: 'Html' }
          ]
        }
      ]
    })
  }
}
</script>

<style lang="less" scoped>
.top {
  width: 100%;
  height: 44px;
  position: relative;
  .arrow{
    width: 109px;
    height: 44px;
    line-height: 44px;
    .arrow-left{
      margin-left: 10px;
    }
  }
  .title {
    position: absolute;
    top: 10px;
    left: 150px;
    color: #1D2129;
    font-size: 17px;
  }
}
.chart-box {
  margin-top: 30px;
  margin-left: 33px;
  width: 300px;
  height: 300px;
}
</style>
